package com.ggs.rg.ybjb.pojomodule.pojo;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author cxw
 * @since 2021-10-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="User对象", description="")
public class TUser implements Serializable  {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "手机号，唯一值，主键")
    @TableId(value = "phone", type = IdType.INPUT)
    private String phone;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "用户类型,用户类型,0为管理员,1为用户")
    private Boolean type;

    @ApiModelProperty(value = "登录状态，非数据库字段，不参与数据库查询")
    @TableField(exist = false)//表示该属性不为数据库表字段，但又是必须使用的。
    private Integer loginStatus;

    @ApiModelProperty(value = "用户头像")
    private String image;

    @ApiModelProperty(value = "数据生成时自动创建时自动")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "数据生成时自动生成，修改时自动更新")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "用户性别,0为男,1为女")
    private Boolean sex;

    @ApiModelProperty(value = "个性签名")
    private String pDesc;

    @ApiModelProperty(value = "用户邮箱")
    private String email;

    @ApiModelProperty(value = "用户余额,保留两位小数")
    private Double money;

    public TUser(String phone,String password,String name,String image){
        this.phone = phone;
        this.password = password;
        this.name = name;
        this.image = image;
    }

    public TUser(String phone){
        this.phone = phone;
    }

}
